<template>
  <div class="listArea">
    <div class="list"  v-for="(item,index) in List" :key="item.id">
    <div>
      <span>{{ index+1 }}.</span>
      <span>{{ item.names }}</span>
    </div>
    <div class="cls_btn" @click="removeTask(item.id)"></div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'ListArea',
  props:{
    List:{
      type:Array,
      required:true
    }
  },
  methods: {
    removeTask(id){
      this.$emit("removeTask",id)
    }
  },
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.listArea{
  color: rgb(111,111,111);
  width: 100%;
  padding: 5px 15px;
  user-select: none;
  box-sizing: border-box;
}
.list{
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 5px;
  border-bottom: 1px solid rgba(114, 114, 114, 0.474);
}
.cls_btn{
  position: relative;
  width: 1.2em;
  height: 1.2em;
  cursor: pointer;
}
.cls_btn::after,.cls_btn::before{
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 1px;
  rotate: 45deg;
  top:50%;
  background-color: red;

}
.cls_btn::before{
  position: absolute;
  content: "";
  rotate: -45deg;
}
</style>
